import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait

driver =  webdriver.Edge()
driver.maximize_window()

driver.get("http://localhost:81/index.php/Home/user/login.html")
# 进行登录
driver.find_element(By.XPATH, '//*[@id="username"]').send_keys("17633863035")
driver.find_element(By.XPATH, '//*[@id="password"]').send_keys("123456")
driver.find_element(By.XPATH, '//*[@id="verify_code"]').send_keys("8888")
driver.find_element(By.XPATH, '//*[@id="loginform"]/div/div[6]/a').click()
time.sleep(3)
# 进行操作
driver.find_element(By.XPATH, '//*[@id="hd-my-cart"]/a/div/i').click()
time.sleep(3)
element = WebDriverWait(driver, 10).until(
    lambda x:x.find_element(By.XPATH, '//*[@id="removeGoods"]')
    )
element.click()
#driver.execute_script("arguments[0].click();", element)


time.sleep(3)
driver.quit()